/*******************************************************************************
 * Copyright 2008 www.softao.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
/**
 * Place holder for copyright, needs to be replaced before release.
 */
package test.com.softao.ming.gwt.client.user;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.TextBox;
import com.softao.ming.gwt.user.client.AbsoluteLayoutForm;
import com.softao.ming.gwt.user.client.GridLayout;

/**
 * {@link GridLayout} test case.
 */
public class GridLayoutForm extends Composite {
	private final GridLayoutFormConstants mConstants = GWT
			.create(GridLayoutFormConstants.class);
	
	private final AbsoluteLayoutForm pnlLayout;
	
	/**
	 * Initializes a new instance of <code>GridLayoutForm</code>.
	 */
	public GridLayoutForm() {
		this.pnlLayout = new AbsoluteLayoutForm(mConstants.layoutPattern());
		
		this.layoutPanel();
		
		this.initWidget(this.pnlLayout);
		this.pnlLayout.setPixelSize(672, 235);
	}
	
	private void layoutPanel() {
		ListBox list = new ListBox(false);
		list.addItem("Test");
		this.pnlLayout.setText(0, "Title:");
		this.pnlLayout.setWidget(1, new TextBox());
		this.pnlLayout.setText(2, "First Name:");
		this.pnlLayout.setWidget(3, new TextBox());
		this.pnlLayout.setText(4, "Last Name:");
		this.pnlLayout.setWidget(5, new TextBox());
		this.pnlLayout.setText(6, "Company:");
		this.pnlLayout.setWidget(7, new TextBox());
		this.pnlLayout.setText(8, "Company Number:");
		this.pnlLayout.setWidget(9, new TextBox());
		this.pnlLayout.setText(10, "Street address:");
		this.pnlLayout.setWidget(11, new TextBox());
		this.pnlLayout.setText(12, "Street Address ln2:");
		this.pnlLayout.setWidget(13, new TextBox());
		this.pnlLayout.setText(14, "City:");
		this.pnlLayout.setWidget(15, new TextBox());
		this.pnlLayout.setText(16, "State:");
		this.pnlLayout.setWidget(17, new TextBox());
		this.pnlLayout.setWidget(18, new RadioButton("Face", "Face"));
		this.pnlLayout.setWidget(19, new CheckBox("Active"));
		this.pnlLayout.setText(20, "Country:");
		this.pnlLayout.setWidget(21, list);
		this.pnlLayout.setText(22, "Telephone Number:");
		this.pnlLayout.setWidget(23, new TextBox());
		this.pnlLayout.setText(24, "Email:");
		this.pnlLayout.setWidget(25, new TextBox());
		this.pnlLayout.setText(26, "General info:");
		this.pnlLayout.setWidget(27, new TextArea());
	}
}
